package com.xunqi.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.xunqi.interceptor.CommonIntercepter;

@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(commonIntercepter()).addPathPatterns("/**").excludePathPatterns("/main/**");
		super.addInterceptors(registry);
	}

	@Bean
	public CommonIntercepter commonIntercepter() {
		return new CommonIntercepter();
	}
}
